import Vue from 'vue';
import App from './App.vue';

import vueRouter from 'vue-router';//导入路由
Vue.use(vueRouter);//绑定路由

import vuResource from 'vue-resource';
Vue.use(vuResource);

import moment from 'moment';
Vue.filter('datefmt',function(input,fmtstring){
	return moment(input).format(fmtstring);
})

import 'mint-ui/lib/style.css';
import Mint from 'mint-ui';
Vue.use(Mint);
import '../statics/mui/css/mui.css';//Mint UI的css文件

import VuePreview from 'vue-preview'
Vue.use(VuePreview)

import '../statics/css/site.css';//MUI的css文件

//import login from './components/account/login.vue';
//import reg from './components/account/reg.vue';
import home from './components/home/home.vue';
import vip from './components/vip/vip.vue';
import shopcar from './components/shopcar/shopcar.vue';
import search from './components/search/search.vue';
import news from './components/home/news/news.vue';
import newsinfo from './components/home/news/newsinfo.vue';
import photo from './components/home/photo/photo.vue';
import photoinfo from './components/home/photo/photoinfo.vue';

var router = new vueRouter({
	linkActiveClass:'mui-active',
	routes:[
		//{path:'/login',component:login},
		//{path:'/reg',component:reg}
		{path:'/',redirect:'/home'},
		{path:'/home',component:home},
		{path:'/vip',component:vip},
		{path:'/shopcar',component:shopcar},
		{path:'/search',component:search},
		{path:'/news',component:news},
		{path:'/news/newsinfo/:id',component:newsinfo},
		{path:'/photo',component:photo},
		{path:'/photo/photoinfo/:id',component:photoinfo}

	]
});

// 3.0 利用Vue对象进行解析渲染
new Vue({
	el:'#app',
	router,
	// render:function(create){create(App)} //es5的写法
	render:c=>c(App)// es6的函数写法 =>：goes to
});